import Vue from 'vue'
import VueStorage from 'vue-ls'
import config from '@/config/defaultSettings'

// base library

import Antd from 'ant-design-vue'
import Viser from 'viser-vue'
import VueCropper from 'vue-cropper'
import 'ant-design-vue/dist/antd.less'

// ext library
import VueClipboard from 'vue-clipboard2'
import MultiTab from '@/components/MultiTab'
import PageLoading from '@/components/PageLoading'
import PermissionHelper from '@/utils/helper/permission'
//import FlymeFlowDesign from 'flyme-flow-design'
import KFormDesign from 'k-form-design/lib/k-form-design-mini.umd.min'
import 'k-form-design/lib/k-form-design.css'

// import '@/components/use'
import './directives/action'
//网络请求成功状态值
Vue.prototype.$httpStatus = 100
import { VueAxios, httpClient, api, axios } from '../utils/request'

//vxe-table第三方table组件
import 'xe-utils'
import 'vxe-table/lib/index.css'
import VXETable from 'vxe-table'

import 'viewerjs/dist/viewer.css'
import Viewer from 'v-viewer'
//图片懒加载
import VueLazyload from 'vue-lazyload'


//表单验证
import { rules } from '@/utils/validate'
//自定义组件
import installComponet from '@/components/Flyme'
//事件总线
import VueBus from './vue-bus'

import { dictFormat, columnFormatter } from '@/utils/dictUtil'
import MeiDaPlugs from 'meida-plugins'
import Print from 'vue-print-nb'

Vue.use(Print)
Vue.prototype.dictFormat = dictFormat
Vue.prototype.columnFormatter = columnFormatter

//定义全局变量
Vue.prototype.http = httpClient
Vue.prototype.api = api
Vue.prototype.axios = axios
Vue.prototype.rules = rules

VueClipboard.config.autoSetContainer = true
Vue.config.productionTip = false

//网络请求
Vue.use(VueAxios)
Vue.use(VueBus)
Vue.use(Viewer)
Viewer.setDefaults({
  Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' }
})
Vue.use(Antd)
Vue.use(Viser)
Vue.use(MultiTab)
Vue.use(PageLoading)
Vue.use(VueStorage, config.storageOptions)
Vue.use(VueClipboard)
Vue.use(PermissionHelper)
Vue.use(VueCropper)
Vue.use(KFormDesign)
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: require('@/assets/default.png'),
  loading: require('@/assets/loading.gif'),
  attempt: 1
})

Vue.use(VXETable)
/**
 * 注册自定义组件
 */

installComponet(Vue)

//Vue.use(MeiDaPlugs)
//Vue.use(FlymeFlowDesign)